package com.xingfly.util;

/**
 * 用户操作类型消息提醒类型
 * Created by SuperS on 2016/12/7.
 */
public class Type {
    //未读
    public static final int UNREAD = 0;
    //已读
    public static final int READ = 1;

    //blog
    public static final int OBJECT_TYPE_POST = 1;
    //图片
    public static final int OBJECT_TYPE_PHOTO = 2;
    //追随
    public static final int OBJECT_TYPE_FOLLOWING = 3;
    //动态
    public static final int OBJECT_TYPE_DYNAMIC = 4;

    public static final int OBJECT_TYPE_USER = 5;

    public static final int OBJECT_TYPE_COMMENT = 6;


    //系统提醒
    public static final int NOTIFY_TYPE_SYSTEM = 1;
    //评论提醒
    public static final int NOTIFY_TYPE_COMMENT = 2;
    //评论回复提醒
    public static final int NOTIFY_TYPE_COMMENT_REPLY = 3;
    //点赞提醒
    public static final int NOTIFY_TYPE_LIKE = 4;
    //跟随提醒
    public static final int NOTIFY_TYPE_FOLLOW = 5;

    /**
     * 将事件类型数字 转换为 字符串
     */
    public static String toObjectTypeStr(int objectType) {
        String type = null;
        switch (objectType) {
            case OBJECT_TYPE_POST:
                type = "POST";
                break;
            case OBJECT_TYPE_PHOTO:
                type = "PHOTO";
                break;
            case OBJECT_TYPE_FOLLOWING:
                type = "FOLLOWING";
                break;
            case OBJECT_TYPE_DYNAMIC:
                type = "DYNAMIC";
                break;
            default:
                break;
        }
        return type;
    }

    /**
     * 将事件类型字符串转换为数字
     */
    public static Integer toObjectTypeInt(String objectType) {
        Integer type = null;
        switch (objectType) {
            case "POST":
                type = OBJECT_TYPE_POST;
                break;
            case "PHOTO":
                type = OBJECT_TYPE_PHOTO;
                break;
            case "FOLLOWING":
                type = OBJECT_TYPE_FOLLOWING;
                break;
            case "DYNAMIC":
                type = OBJECT_TYPE_DYNAMIC;
                break;
            case "COMMENT":
                type = OBJECT_TYPE_COMMENT;
                break;
            default:
                break;
        }
        return type;
    }


    /**
     * 将提醒类型数字 转换为 字符串
     */
    public static String toNotifyTypeStr(int notifyType) {
        String type = null;
        switch (notifyType) {
            case NOTIFY_TYPE_SYSTEM:
                type = "SYSTEM";
                break;
            case NOTIFY_TYPE_COMMENT:
                type = "COMMENT";
                break;
            case NOTIFY_TYPE_COMMENT_REPLY:
                type = "COMMENT_REPLAY";
                break;
            case NOTIFY_TYPE_LIKE:
                type = "LIKE";
                break;
            case NOTIFY_TYPE_FOLLOW:
                type = "FOLLOW";
                break;
            default:
                break;
        }
        return type;
    }


}
